<template>
	<view :style="colorStyle + 'background-image: url('+bgPic+');'" class="detail_view">
		<skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
			bgcolor="#FFF"></skeleton>
		<!-- 头部 -->
		<!-- #ifdef APP-PLUS -->
		<view class="navbar" :style="{ height: navH + 'rpx', opacity: opacity, paddingTop: sysHeight }">
			<!-- #endif -->
			<!-- #ifndef APP-PLUS -->
			<view class='navbar' :style="{height:navH+'rpx',opacity:opacity}">
				<!-- #endif -->
				<view class='navbarH' :style='"height:"+navH+"rpx;"'>
					<view class='navbarCon acea-row row-center-wrapper'>
						<view class="header acea-row row-center-wrapper">
							<view class="item" :class="navActive === index ? 'on' : ''" v-for="(item,index) in navList"
								:key='index' @tap="tap(item,index)">
								{{ item }}
							</view>
						</view>
					</view>
				</view>
			</view>
			<!-- #ifdef APP-PLUS -->
			<view id="home" class="home-nav acea-row row-center-wrapper" :class="[opacity>0.5?'on':'']"
				:style="{ top:(navH/2-28)+'rpx' ,marginTop:sysHeight}">
				<!-- #endif -->
				<!-- #ifndef APP-PLUS -->
				<view id="home" class="home-nav acea-row row-center-wrapper" :class="[opacity>0.5?'on':'']"
					:style="{ top: homeTop +'rpx'}">
					<!-- #endif -->
					<view class="iconfont icon-fanhui2" @tap="returns"></view>
					<!-- #ifdef MP -->
					<view class="line"></view>
					<view class="iconfont icon-gengduo5" @click="moreNav"></view>
					<!-- #endif -->
				</view>


				<!-- #ifdef APP-PLUS -->
				<view id="home" class="home-nav right acea-row row-center-wrapper" :class="[opacity>0.5?'on':'']"
					:style="{ top:(navH/2-28)+'rpx' ,marginTop:sysHeight}">
					<!-- #endif -->
					<!-- #ifdef H5 -->
					<view id="home" class="home-nav right acea-row row-center-wrapper" :class="[opacity>0.5?'on':'']"
						:style="{ top: homeTop +'rpx'}">
						<!-- #endif -->
						<!-- #ifdef APP-PLUS || H5 -->
						<view class="iconfont icon-gengduo2" @click="moreNav"></view>
					</view>
					<!-- #endif -->
					<homeList :navH="navH" :returnShow="returnShow" :currentPage="currentPage" :sysHeight="sysHeight">
					</homeList>
					<view class='product-con skeleton' :style="{visibility: showSkeleton ? 'hidden' : 'visible'}">
						<scroll-view :scroll-top="scrollTop" scroll-y='true' scroll-with-animation="true"
							:style="'height:'+height+'px;'" @scroll="scroll">
							<view id="past0">
								<productConSwiper class="skeleton-rect" :imgUrls='imgUrls'></productConSwiper>
								<view class="bg-color">
									<view class='nav acea-row row-between-wrapper'>
										<view class='money skeleton-rect'>
											<image src="../../../static/images/miaosha.png" mode=""></image>
											<text>限时采购</text>
										</view>
										<view class='acea-row row-middle skeleton-rect'>
											<view class='timeItem' v-if="status == 1">
												<view>距结束仅剩</view>
												<countDown :is-day="false" :tip-text="' '" :day-text="' '"
													:hour-text="' : '" :minute-text="' : '" :second-text="' '"
													:datatime="datatime" style="margin-top: 4rpx;"></countDown>
											</view>
											<!-- <view class="timeState" wx:if="{{status == 0}}">已结束</view>
						  <view class="timeState" wx:if="{{status == 2}}">即将开始</view> -->
											<!-- <view class='iconfont icon-jiantou'></view> -->
										</view>
									</view>
								</view>


								<view class="content_">
									<view class='wrapper'>
										<view class="price_box">
											<view class="price">
												￥<text class='num'>{{storeInfo.price}}</text>
												<text
													v-if="attribute.productAttr.length && (attribute.productAttr.length?attribute.productAttr[0].attr_values.length:0) > 1">起</text>
												<text class='y-money'>￥{{storeInfo.ot_price}}</text>
											</view>
											<view class='iconfont icon-fenxiang skeleton-rect'
												@click="listenerActionSheet" v-if="base64Show"></view>
										</view>
										<view class='introduce acea-row row-between'>
											<view class='infor skeleton-rect'>
												
											</view>
										</view>
										<!-- <view class='label acea-row row-middle skeleton-rect'>
											<view class='stock'>库存：{{storeInfo.stock}}{{storeInfo.unit_name}}</view>
											<view class='stock'>
												累计销售：{{storeInfo.total?storeInfo.total:0}}{{storeInfo.unit_name || ''}}
											</view>
											<view>限量:
												{{ storeInfo.quota_show ? storeInfo.quota_show : 0 }}{{storeInfo.unit_name || ''}}
											</view>
										</view> -->

										<view class="ISactive">
											<view class="left">
												参与活动
											</view>
											<view class="box">
												<image src="../../../static/images/Index_tab_icon18.png" mode="">
												</image>
												<text>限时采购</text>
											</view>
										</view>

										<view class="introduce_bottom">
											<view v-if="storeInfo.product_id==99 || storeInfo.product_id==100">
												<view class="title">
													药膳鸡
												</view>
												<view class="msg">
													名称
												</view>
											</view>
											
											<view v-else>
												<view class="title" v-if="storeInfo.product_id==103">
													土鸡
												</view>
												<view class="title" v-else>
													生态鸡
												</view>
												<view class="msg">
													品种
												</view>
											</view>
											<view>
												<view class="title">
													两年左右
												</view>
												<view class="msg">
													饲养周期
												</view>
											</view>
											<view>
												<view class="title" v-if="storeInfo.product_id==103">
													2.0KG-2.5KG
												</view>
												<view class="title" v-else>
													1.5KG+
												</view>
												<view class="msg">
													重量(只)
												</view>
											</view>
										</view>

									</view>

									<view class="wrapper wrapper3">
										
										<view v-if="storeInfo.product_id==99 || storeInfo.product_id==100">
											<image src="../../../static/images/Index_tab_icon15.png" mode=""></image>
											<view class="title">
												实时提货
											</view>
											<view class="msg">
												提货时间
											</view>
										</view>
										<view v-else>
											<image src="../../../static/images/Index_tab_icon15.png" mode=""></image>
											<view class="title">
												实时提货
												<!-- {{month_give_num}}个月 -->
											</view>
											<view class="msg" v-if="storeInfo.product_id==103">

												提货完成
											</view>
											<view class="msg" v-else>
												提货时间
											</view>
										</view>
										<view>
											<image src="../../../static/images/Index_tab_icon16.png" mode=""></image>
											<view class="title">
												市场补贴
											</view>
											<view class="msg">
												店铺
											</view>
										</view>
										<view>
											<image src="../../../static/images/Index_tab_icon22.png" mode=""></image>
											<view class="title" v-if="storeInfo.product_id==103">
												礼盒配送
											</view>
											<view class="title" v-else>
												物流配送
											</view>
											<view class="msg">
												发货类型
											</view>
										</view>
									</view>


									<view class="wrapper wrapper4" v-if="renyangArr.length != 0">
										<view class='title' :style="'background-image: url('+baURL+');'">
											<view class='pictrue skeleton-rect'>
												市场补贴
											</view>
											<image src="~@/static/images/Index_tab_icon4.png" class="tab_icon"
												mode=""></image>
										</view>
									
										<view class="list">
											<view v-for="item in renyangArr">
												<image :src="item.image" mode="">
												</image>
												<text>{{item.store_name}}</text>（
												<text>{{item.total_num}}只/月）</text>
											</view>
										</view>
									</view>

									<view class="wrapper wrapper4 wrapper5">
										<view class='title' :style="'background-image: url('+baURL+');'">
											<view class='pictrue skeleton-rect'>
												采购流程
											</view>
											<image src="../../../static/images/Index_tab_icon5.png" class="tab_icon"
												mode=""></image>
										</view>

										<view class="list">
											<view class="listDV">
												<view class="left">
													<image src="../../../static/images/Index_tab_icon7.png" mode="">
													</image>
													<view class="dv">
														<view class="dv1">
															提货时间
														</view>
														<view class="dv2">
															2022-01-01至2022-12-30
														</view>
														<!-- <view class="dv2" v-else>
															下单成功之日起{{month_give_num}}个月内完成提货
														</view> -->
														<view class="dv3">
															输入相关信息，确认支付
														</view>
													</view>
												</view>
												<view class="right">
													<image src="../../../static/images/Index_tab_icon10.png"
														style="width: 149rpx;height: 128rpx;" mode=""></image>
												</view>
											</view>
											<view class="listDV">
												<view class="left">
													<image src="../../../static/images/Index_tab_icon8.png" mode="">
													</image>
													<view class="dv">
														<view class="dv1">
															采购颜值
														</view>
														<view class="dv2">
															2022-01-01至2022-12-30
														</view>
														<!-- <view class="dv2" v-if="storeInfo.product_id==99 || storeInfo.product_id==100">
															2022-01-01至2022-12-30
														</view> -->
														<!-- <view class="dv2" v-else>
															下单成功之日起{{month_give_num}}个月内完成提货
														</view> -->
														<view class="dv3">
															农场收到订单后，用户可线上操作提货
														</view>
													</view>
												</view>
												<view class="right">
													<image src="../../../static/images/Index_tab_icon11.png"
														style="width: 129rpx;height: 122rpx;" mode=""></image>
												</view>
											</view>
											<view class="listDV">
												<view class="left">
													<image src="../../../static/images/Index_tab_icon9.png" mode="">
													</image>
													<view class="dv">
														<view class="dv1">
															配送或自提
														</view>
														<view class="dv2">
															2022-01-01至2022-12-30
														</view>
														<!-- <view class="dv2" v-if="storeInfo.product_id==99 || storeInfo.product_id==100">
															2022-01-01至2022-12-30
														</view> -->
														<!-- <view class="dv2" v-else>
															下单成功之日起{{month_give_num}}个月内完成提货
														</view> -->
														<view class="dv3">
															根据用户需求配送到家或提货点提货
														</view>
													</view>
												</view>
												<view class="right">
													<image src="../../../static/images/Index_tab_icon12.png"
														style="width: 141rpx;height: 99rpx;" mode=""></image>
												</view>
											</view>
										</view>
									</view>

									<view class="wrapper wrapper4" id="past2">
										<view class='title' :style="'background-image: url('+baURL+');'">
											<view class='pictrue skeleton-rect'>
												产品详情
											</view>
											<image src="../../../static/images/Index_tab_icon6.png" class="tab_icon"
												mode=""></image>
										</view>

										<view class='conter'>
											<view class="" v-html="storeInfo.description">
											</view>
										</view>
									</view>

								</view>
							</view>
							<view class='userEvaluation skeleton-rect' id="past1" v-if="replyCount">
								<view class='title acea-row row-between-wrapper'>
									<view>用户评价({{replyCount}})</view>
									<navigator class='praise' hover-class='none'
										:url="'/pages/users/goods_comment_list/index?product_id='+storeInfo.product_id">
										<text class='font-color'>{{replyChance}}%</text>好评率
										<text class='iconfont icon-jiantou'></text>
									</navigator>
								</view>
								<userEvaluation :reply="reply"></userEvaluation>
							</view>
							<!-- <view class='product-intro' id="past2">
								<view class='title'>产品介绍</view>
								<view class='conter'>
									<view class="" v-html="storeInfo.description">
									</view>
								</view>
							</view> -->
						</scroll-view>
						<view class='footer acea-row row-between-wrapper'>
							<!-- #ifdef MP -->
							<!-- <button open-type="contact" hover-class='none' class='item'>
					<view class='iconfont icon-kefu'></view>
					<view class="p_center">客服</view>
				</button> -->
							<!-- #endif -->
							<!-- #ifndef MP -->
							<!-- 	<navigator hover-class="none" class="item" url="/pages/customer_list/chat">
					<view class="iconfont icon-kefu"></view>
					<view class="p_center">客服</view>
				</navigator> -->
							<!-- #endif -->
							<navigator hover-class="none" open-type="switchTab" class="item skeleton-rect"
								url="/pages/index/index">
								<view class="iconfont icon-shouye6"></view>
								<view class="p_center">首页</view>
							</navigator>
							<view @tap='setCollect' class='item skeleton-rect'>
								<view class='iconfont icon-shoucang1' v-if="storeInfo.userCollect"></view>
								<view class='iconfont icon-shoucang' v-else></view>
								<view class="p_center">收藏</view>
							</view>
							<view class="bnt acea-row skeleton-rect"
								v-if="status == 1 && attribute.productSelect.quota > 0 && attribute.productSelect.product_stock>0">
								<view class="joinCart bnts"style="background: #bbbbbb; color: #FFFFFF;">单独采购</view>
								<view class="buy bnts" @tap="goCat">立即采购</view>
							</view>
							<view class="bnt acea-row skeleton-rect"
								v-if="(status == 1 && attribute.productSelect.quota <= 0) || (status == 3 && attribute.productSelect.quota <= 0) || (status == 1 && attribute.productSelect.product_stock <= 0) || (status == 3 && attribute.productSelect.product_stock <= 0)">
								<view class="joinCart bnts" style="background: #bbbbbb; color: #FFFFFF;">单独采购</view>
								<view class="buy bnts bg-color-hui">已售罄</view>
							</view>
							<view class="bnt acea-row skeleton-rect" v-if="!dataShow && status == 1">
								<view class="joinCart bnts" style="background: #bbbbbb; color: #FFFFFF;">单独采购</view>
								<view class="buy bnts bg-color-hui">立即采购</view>
							</view>
							<view class="bnt acea-row skeleton-rect" v-if="status == 2">
								<view class="joinCart bnts" style="background: #bbbbbb; color: #FFFFFF;">单独采购</view>
								<view class="buy bnts bg-color-hui">未开始</view>
							</view>
							<view class="bnt acea-row skeleton-rect" v-if="status == 0">
								<view class="joinCart bnts" style="background: #bbbbbb; color: #FFFFFF;">单独采购</view>
								<view class="buy bnts bg-color-hui">已结束</view>
							</view>
						</view>
					</view>
					<product-window :attr='attribute' :limitNum='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
						:type="'seckill'" @ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum"
						@getImg="showImg"></product-window>
					<!-- #ifdef MP -->
					<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth"></authorize> -->
					<!-- #endif -->
					<!-- 分享按钮 -->
					<view class="generate-posters" :class="posters ? 'on' : ''">
						<view class="generateCon acea-row row-middle">
							<!-- #ifndef MP -->
							<button class="item" hover-class='none' v-if="weixinStatus === true"
								@click="H5ShareBox = true">
								<!-- <button class="item" hover-class='none' v-if="weixinStatus === true" @click="setShareInfoStatus"> -->
								<!-- <view class="iconfont icon-weixin3"></view> -->
								<view class="pictrue">
									<image src="../../../static/images/weixin.png"></image>
								</view>
								<view class="">分享给好友</view>
							</button>
							<!-- #endif -->
							<!-- #ifdef MP -->
							<button class="item" open-type="share" hover-class='none'>
								<!-- <view class="iconfont icon-weixin3"></view> -->
								<view class="pictrue">
									<image src="../../../static/images/weixin.png"></image>
								</view>
								<view class="">分享给好友</view>
							</button>
							<!-- #endif -->
							<!-- #ifdef APP-PLUS -->
							<view class="item" @click="appShare('WXSceneSession')">
								<!-- <view class="iconfont icon-weixin3"></view> -->
								<view class="pictrue">
									<image src="../../../static/images/weixin.png"></image>
								</view>
								<view class="">分享给好友</view>
							</view>
							<!-- <view class="item" @click="appShare('WXSenceTimeline')">
					<view class="iconfont icon-pengyouquan"></view>
					<view class="">微信朋友圈</view>
				</view> -->
							<!-- #endif -->
							<view class="item" @click="getpreviewImage">
								<view class="pictrue">
									<image src="../../../static/images/changan.png"></image>
								</view>
								<view class="">预览发图</view>
							</view>
							<!-- #ifndef H5  -->
							<button class="item" hover-class='none' @tap="savePosterPath">
								<!-- <view class="iconfont icon-haibao"></view> -->
								<view class="pictrue">
									<image src="../../../static/images/haibao.png"></image>
								</view>
								<view class="">保存海报</view>
							</button>
							<!-- #endif -->
						</view>
						<view class="generateClose acea-row row-center-wrapper" @click="posterImageClose">取消</view>
					</view>
					<view class="mask" v-if="posters"></view>

					<!-- 海报展示 -->
					<view class='poster-pop' v-if="posterImageStatus">
						<!-- <image src='/static/images/poster-close.png' class='close' @click="posterImageClose"></image> -->
						<image :src='posterImage'></image>
						<!-- #ifndef H5  -->
						<!-- 	<view class='save-poster' @click="savePosterPath">保存到手机</view> -->
						<!-- #endif -->
						<!-- #ifdef H5 -->
						<!-- <view class="keep">长按图片可以保存到手机</view> -->
						<!-- #endif -->
					</view>
					<view class='mask1' v-if="posterImageStatus"></view>
					<canvas class="canvas" canvas-id='myCanvas' v-if="canvasStatus"></canvas>
					<kefuIcon :ids='storeInfo.product_id' :routineContact='routineContact'></kefuIcon>
					<!-- 发送给朋友图片 -->
					<view class="share-box" v-if="H5ShareBox">
						<image src="/static/images/share-info.png" @click="H5ShareBox = false"></image>
					</view>
					<!-- #ifdef H5 || APP-PLUS -->
					<zb-code ref="qrcode" :show="codeShow" :cid="cid" :val="codeVal" :size="size" :unit="unit"
						:background="background" :foreground="foreground" :pdground="pdground" :icon="codeIcon"
						:iconSize="iconsize" :onval="onval" :loadMake="loadMake" @result="qrR" />
					<!-- #endif -->
					<cusPreviewImg ref="cusPreviewImg" :list="skuArr" @changeSwitch="changeSwitch"></cusPreviewImg>
				</view>
</template>

<script>
	const app = getApp();
	let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
	import zbCode from '@/components/zb-code/zb-code.vue'
	import {
		mapGetters
	} from "vuex";
	import {
		getSeckillDetail,
		seckillCode
	} from '@/api/activity.js';
	import {
		postCartAdd,
		collectAdd,
		collectDel
	} from '@/api/store.js';
	import storeLis from '@/components/storeLis';
	import productConSwiper from '@/components/productConSwiper/index.vue'
	import productWindow from '@/components/productWindow/index.vue'
	import userEvaluation from '@/components/userEvaluation/index.vue'
	import kefuIcon from '@/components/kefuIcon';
	import cusPreviewImg from '@/components/cusPreviewImg';
	import homeList from '@/components/homeList'
	// #ifdef MP
	import authorize from '@/components/Authorize';
	// #endif
	import parser from "@/components/mp-html/mp-html";
	import countDown from '@/components/countDown';
	import {
		colorChange
	} from '@/api/api.js';
	import {
		imageBase64
	} from "@/api/public";
	import {
		toLogin
	} from '@/libs/login.js';
	import {
		silenceBindingSpread
	} from "@/utils";
	import {
		getUserInfo
	} from '@/api/user.js';
	// #ifdef APP-PLUS
	import {
		TOKENNAME,
		HTTP_REQUEST_URL
	} from '@/config/app.js';
	// #endif
	import colors from '@/mixins/color.js';
	export default {
		computed: mapGetters(['isLogin']),
		mixins: [colors],
		data() {
			return {
				showSkeleton: true, //骨架屏显示隐藏
				isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
				dataShow: 0,
				id: 0,
				time: 0,
				month_give_num: 0,
				commission_money: 0,
				countDownHour: "00",
				countDownMinute: "00",
				countDownSecond: "00",
				storeInfo: [],
				imgUrls: [],
				parameter: {
					'navbar': '1',
					'return': '1',
					'title': '抢购详情页',
					'color': false
				},
				attribute: {
					cartAttr: false,
					productAttr: [],
					productSelect: {}
				},
				productValue: [],
				isOpen: false,
				attr: '请选择',
				attrValue: '',
				status: 1,
				isAuto: false,
				isShowAuth: false,
				iShidden: false,
				limitNum: 1, //限制本属性产品的个数；
				iSplus: false,
				replyCount: 0, //总评论数量
				reply: [], //评论列表
				replyChance: 0,
				navH: "",
				navList: ['商品', '评价', '详情'],
				opacity: 0,
				scrollY: 0,
				topArr: [],
				toView: '',
				height: 0,
				heightArr: [],
				lock: false,
				scrollTop: 0,
				tagStyle: {
					img: 'width:100%;display:block;',
					table: 'width:100%',
					video: 'width:100%'
				},
				datatime: 0,
				navActive: 0,
				meunHeight: 0,
				backH: '',
				posters: false,
				weixinStatus: false,
				posterImageStatus: false,
				canvasStatus: false, //海报绘图标签
				storeImage: '', //海报产品图
				PromotionCode: '', //二维码图片
				posterImage: '', //海报路径
				posterbackgd: '/static/images/posterbackgd.png',
				actionSheetHidden: false,
				renyangArr:[],
				cart_num: '',
				homeTop: 20,
				returnShow: true,
				H5ShareBox: false, //公众号分享图片
				routineContact: 0,
				siteName: '', //商城名称
				themeColor: '',
				fontColor: '',
				skuArr: [],
				//二维码参数
				codeShow: false,
				cid: '1',
				codeVal: "", // 要生成的二维码值
				size: 200, // 二维码大小
				unit: 'upx', // 单位
				background: '#FFF', // 背景色
				foreground: '#000', // 前景色
				pdground: '#000', // 角标色
				codeIcon: '', // 二维码图标
				iconsize: 40, // 二维码图标大小
				lv: 3, // 二维码容错级别 ， 一般不用设置，默认就行
				onval: true, // val值变化时自动重新生成二维码
				loadMake: true, // 组件加载完成后自动生成二维码
				base64Show: 0,
				shareQrcode: 0,
				followCode: '',
				selectSku: {},
				currentPage: false,
				sysHeight: sysHeight,
				bgPic: '../../../static/images/Index_banner6.png',
				baURL: '../../../static/images/Index_banner2.png'
			}
		},
		components: {
			zbCode,
			storeLis,
			productConSwiper,
			'productWindow': productWindow,
			userEvaluation,
			kefuIcon,
			cusPreviewImg,
			"jyf-parser": parser,
			countDown,
			homeList,
			// #ifdef MP
			authorize
			// #endif
		},
		computed: mapGetters(['isLogin']),
		watch: {
			isLogin: {
				handler: function(newV, oldV) {
					if (newV) {
						this.getSeckillDetail();
					}
				},
				deep: true
			}
		},
		onLoad(options) {
			let that = this
			let statusBarHeight = ''
			var pages = getCurrentPages();
			that.returnShow = pages.length === 1 ? false : true;
			//设置商品列表高度
			uni.getSystemInfo({
				success: function(res) {
					that.height = res.windowHeight
					statusBarHeight = res.statusBarHeight
					//res.windowHeight:获取整个窗口高度为px，*2为rpx；98为头部占据的高度；
				},
			});
			this.isLogin && silenceBindingSpread();
			// #ifndef APP-PLUS
			this.navH = app.globalData.navHeight
			// #endif
			// #ifdef APP-PLUS
			this.navH = 90
			// #endif
			// #ifdef MP
			let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
			this.meunHeight = menuButtonInfo.height
			this.backH = (that.navH / 2) + (this.meunHeight / 2)

			//扫码携带参数处理
			if (options.scene) {
				let value = this.$util.getUrlParams(decodeURIComponent(options.scene));
				if (value.id) {
					this.id = value.id;
				} else {
					this.showSkeleton = false;
					return this.$util.Tips({
						title: '缺少参数无法查看商品'
					}, {
						tab: 3,
						url: 1
					});
				}
				//记录推广人uid
				if (value.pid) app.globalData.spid = value.pid;
				// if (value.time) this.datatime = value.time
			}
			// #endif

			if (options.id) {
				this.id = options.id
				// this.status = options.status
				//记录推广人uid
				if (options.pid) app.globalData.spid = options.pid;
				// if (options.time) this.datatime = Number(options.time);
			}
			if (this.isLogin && options.id) {
				// #ifdef MP
				that.downloadFilePromotionCode();
				// #endif
				this.getSeckillDetail();
			} else {
				toLogin();
			}
			this.$nextTick(() => {
				// #ifdef MP
				const menuButton = uni.getMenuButtonBoundingClientRect();
				const query = uni.createSelectorQuery().in(this);
				query
					.select('#home')
					.boundingClientRect(data => {
						this.homeTop = menuButton.top * 2 + menuButton.height - data.height;
					})
					.exec();
				// #endif
			})
			let color = [{
					themeColor: '#1DB0FC',
					fontColor: '#FD502F'
				},
				{
					themeColor: '#42CA4D',
					fontColor: '#FF7600'
				},
				{
					themeColor: '#e93323',
					fontColor: '#e93323'
				},
				{
					themeColor: '#FF448F',
					fontColor: '#FF448F'
				},
				{
					themeColor: '#FE5C2D',
					fontColor: '#FE5C2D'
				}
			];
			colorChange('color_change').then(res => {
				switch (res.data.status) {
					case 1:
						this.themeColor = color[0].themeColor;
						this.fontColor = color[0].fontColor;
						break;
					case 2:
						this.themeColor = color[1].themeColor;
						this.fontColor = color[1].fontColor;
						break;
					case 3:
						this.themeColor = color[2].themeColor;
						this.fontColor = color[2].fontColor;
						break;
					case 4:
						this.themeColor = color[3].themeColor;
						this.fontColor = color[3].fontColor;
						break;
					case 5:
						this.themeColor = color[4].themeColor;
						this.fontColor = color[4].fontColor;
						break;
					default:
						this.themeColor = color[2].themeColor;
						this.fontColor = color[2].fontColor;
						break
				}
			});
		},
		onReady() {
			this.isNodes++;
			// #ifdef H5
			this.codeVal = window.location.origin + '/pages/activity/goods_seckill_details/index?id=' + this.id +
				'&pid=' + this.$store.state.app.uid
			// #endif	
			// #ifdef APP-PLUS
			this.codeVal = HTTP_REQUEST_URL + '/pages/activity/goods_seckill_details/index?id=' + this.id +
				'&pid=' + this.$store.state.app.uid
			// #endif	
		},
		methods: {
			moreNav() {
				this.currentPage = !this.currentPage
			},
			//点击sku图片打开轮播图
			showImg(index) {
				this.$refs.cusPreviewImg.open(this.selectSku.suk)
			},
			//滑动轮播图选择商品
			changeSwitch(e) {
				let productSelect = this.skuArr[e];
				this.$set(this, 'selectSku', productSelect);
				var skuList = productSelect.suk.split(',');
				skuList.forEach((i, index) => {
					this.$set(this.attribute.productAttr[index], 'index', skuList[index]);
				})
				if (productSelect) {
					this.$set(this.attribute.productSelect, "image", productSelect.image);
					this.$set(this.attribute.productSelect, "price", productSelect.price);
					this.$set(this.attribute.productSelect, "stock", productSelect.stock);
					this.$set(this.attribute.productSelect, "unique", productSelect.unique);
					this.$set(this.attribute.productSelect, "cart_num", 1);
					this.$set(this.attribute.productSelect, "quota", productSelect.quota);
					this.$set(this.attribute.productSelect, "quota_show", productSelect.quota_show);
					this.$set(this, "attrValue", productSelect.suk);
					this.attrTxt = "已选择"
				}
			},
			qrR(res) {
				// #ifdef H5
				if (!this.$wechat.isWeixin() || this.shareQrcode != '1') {
					this.PromotionCode = res;
					this.followCode = ''
				}
				// #endif
				// #ifdef APP-PLUS
				this.PromotionCode = res;
				// #endif
			},
			// 图片预览；
			getpreviewImage: function() {
				if (this.posterImage) {
					let photoList = [];
					photoList.push(this.posterImage)
					uni.previewImage({
						urls: photoList,
						current: this.posterImage
					});
				} else {
					his.$util.Tips({
						title: '您的海报尚未生成'
					});
				}
			},

			// app分享
			// #ifdef APP-PLUS
			appShare(scene) {
				let that = this
				let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
				let curRoute = routes[routes.length - 1].$page.fullPath // 获取当前页面路由，也就是最后一个打开的页面路由
				uni.share({
					provider: "weixin",
					scene: scene,
					type: 0,
					href: `${HTTP_REQUEST_URL}${curRoute}`,
					title: that.storeInfo.title,
					summary: that.storeInfo.info,
					imageUrl: that.storeInfo.small_image,
					success: function(res) {
						uni.showToast({
							title: '分享成功',
							icon: 'success'
						})
						// that.posters = false;
					},
					fail: function(err) {
						uni.showToast({
							title: '分享失败',
							icon: 'none',
							duration: 2000
						})
						// that.posters = false;
					}
				});
			},
			// #endif
			/**
			 * 购物车手动填写
			 * 
			 */
			iptCartNum: function(e) {
				this.$set(this.attribute.productSelect, 'cart_num', e);
				this.$set(this, "cart_num", e);
			},
			// 后退
			returns: function() {
				// #ifdef H5
				return history.back();
				// #endif
				// #ifndef H5
				return uni.navigateBack({
					delta: 1,
				})
				// #endif
			},
			onLoadFun: function(data) {
				if (this.isAuto) {
					this.isAuto = false;
					this.isShowAuth = false;
					this.getSeckillDetail();
				}
			},
			getSeckillDetail: function() {
				let that = this;
				getSeckillDetail(that.id).then(res => {
					this.dataShow = 1;
					this.month_give_num = res.data.month_give_num;
					this.commission_money = res.data.storeInfo.commission_money;
					let title = res.data.storeInfo.title;
					this.storeInfo = res.data.storeInfo;
					this.datatime = Number(res.data.storeInfo.last_time);
					this.status = res.data.storeInfo.status;
					this.imgUrls = res.data.storeInfo.images;
					this.storeInfo.description = this.storeInfo.description.replace(/<img/gi,
						'<img style="max-width:100%;height:auto;float:left;display:block" ');
					this.attribute.productAttr = res.data.productAttr;
					this.productValue = res.data.productValue;
					for (let key in res.data.productValue) {
						let obj = res.data.productValue[key];
						that.skuArr.push(obj)
					}
					
					that.renyangArr = res.data.storeInfo.give_list_array;
					
					
					that.selectSku = that.skuArr[0];
					this.attribute.productSelect.num = res.data.storeInfo.num;
					this.attribute.productSelect.once_num = res.data.storeInfo.once_num;
					this.replyCount = res.data.replyCount;
					this.reply = res.data.reply ? [res.data.reply] : [];
					this.replyChance = res.data.replyChance;
					this.shareQrcode = res.data.share_qrcode;
					that.routineContact = Number(res.data.routine_contact_type);
					uni.setNavigationBarTitle({
						title: title.substring(0, 7) + '...'
					});
					that.siteName = res.data.site_name;
					var navList = ['商品', '详情'];
					if (res.data.replyCount) {
						navList.splice(1, 0, '评价');
					}
					that.$set(that, 'navList', navList);
					// #ifdef H5
					that.storeImage = that.storeInfo.image
					if (this.$wechat.isWeixin() && this.shareQrcode == '1') {
						that.followCode = that.storeInfo.code_base
						that.getImageBase64(1);
					} else {
						that.getImageBase64();
					}
					that.setShare();
					// #endif
					// #ifndef H5
					that.downloadFilestoreImage();
					// #endif
					that.DefaultSelect();
					setTimeout(function() {
						that.infoScroll();
					}, 500);
					app.globalData.openPages = '/pages/activity/goods_seckill_details/index?id=' + that.id +
						'&time=' + that.time +
						'&status=' + that.status + '&pid=' + that.storeInfo.uid;
					// wxParse.wxParse('description', 'html', that.data.storeInfo.description || '', that, 0);
					// wxh.time(that.data.time, that);
					setTimeout(() => {
						that.showSkeleton = false
					}, 300)
				}).catch(err => {
					that.$util.Tips({
						title: err
					}, {
						tab: 3
					})
				});
			},
			setShare: function() {
				this.$wechat.isWeixin() &&
					this.$wechat.wechatEvevt([
						"updateAppMessageShareData",
						"updateTimelineShareData",
						"onMenuShareAppMessage",
						"onMenuShareTimeline"
					], {
						desc: this.storeInfo.info,
						title: this.storeInfo.title,
						link: location.href,
						imgUrl: this.storeInfo.image
					}).then(res => {}).catch(err => {});
			},
			/**
			 * 默认选中属性
			 * 
			 */
			DefaultSelect: function() {
				let self = this
				let productAttr = self.attribute.productAttr;
				let value = [];
				for (var key in this.productValue) {
					if (this.productValue[key].quota > 0) {
						value = this.attribute.productAttr.length ? key.split(",") : [];
						break;
					}
				}
				for (let i = 0; i < productAttr.length; i++) {
					this.$set(productAttr[i], "index", value[i]);
				}
				//sort();排序函数:数字-英文-汉字；
				let productSelect = this.productValue[value.join(",")];
				if (productSelect && productAttr.length) {
					self.$set(
						self.attribute.productSelect,
						"store_name",
						self.storeInfo.title
					);
					self.$set(self.attribute.productSelect, "image", productSelect.image);
					self.$set(self.attribute.productSelect, "price", productSelect.price);
					self.$set(self.attribute.productSelect, "stock", productSelect.stock);
					self.$set(self.attribute.productSelect, "unique", productSelect.unique);
					self.$set(self.attribute.productSelect, "quota", productSelect.quota);
					self.$set(self.attribute.productSelect, "quota_show", productSelect.quota_show);
					self.$set(self.attribute.productSelect, "product_stock", productSelect.product_stock);
					self.$set(self.attribute.productSelect, "cart_num", 1);
					self.$set(self, "attrValue", value.join(","));
					self.attrValue = value.join(",")
				} else if (!productSelect && productAttr.length) {
					self.$set(
						self.attribute.productSelect,
						"store_name",
						self.storeInfo.title
					);
					self.$set(self.attribute.productSelect, "image", self.storeInfo.image);
					self.$set(self.attribute.productSelect, "price", self.storeInfo.price);
					self.$set(self.attribute.productSelect, "quota", 0);
					self.$set(self.attribute.productSelect, "quota_show", 0);
					self.$set(self.attribute.productSelect, "product_stock", 0);
					self.$set(self.attribute.productSelect, "stock", 0);
					self.$set(self.attribute.productSelect, "unique", "");
					self.$set(self.attribute.productSelect, "cart_num", 0);
					self.$set(self, "attrValue", "");
					self.$set(self, "attrTxt", "请选择");
				} else if (!productSelect && !productAttr.length) {
					self.$set(
						self.attribute.productSelect,
						"store_name",
						self.storeInfo.title
					);
					self.$set(self.attribute.productSelect, "image", self.storeInfo.image);
					self.$set(self.attribute.productSelect, "price", self.storeInfo.price);
					self.$set(self.attribute.productSelect, "stock", self.storeInfo.stock);
					self.$set(self.attribute.productSelect, "quota", self.storeInfo.quota);
					self.$set(self.attribute.productSelect, "product_stock", self.storeInfo.product_stock);
					self.$set(
						self.attribute.productSelect,
						"unique",
						self.storeInfo.unique || ""
					);
					self.$set(self.attribute.productSelect, "cart_num", 1);
					self.$set(self.attribute.productSelect, "quota", productSelect.quota);
					self.$set(self.attribute.productSelect, "product_stock", productSelect.product_stock);
					self.$set(self, "attrValue", "");
					self.$set(self, "attrTxt", "请选择");
				}
			},
			selecAttr: function() {
				this.currentPage = false;
				this.attribute.cartAttr = true
			},
			onMyEvent: function() {
				this.$set(this.attribute, 'cartAttr', false);
				this.$set(this, 'isOpen', false);
			},
			/**
			 * 购物车数量加和数量减
			 * 
			 */
			ChangeCartNum: function(changeValue) {
				//changeValue:是否 加|减
				//获取当前变动属性
				let productSelect = this.productValue[this.attrValue];
				if (this.cart_num) {
					productSelect.cart_num = this.cart_num;
					this.attribute.productSelect.cart_num = this.cart_num;
				}
				//如果没有属性,赋值给商品默认库存
				if (productSelect === undefined && !this.attribute.productAttr.length)
					productSelect = this.attribute.productSelect;
				//无属性值即库存为0；不存在加减；
				if (productSelect === undefined) return;
				let stock = productSelect.stock || 0;
				let quotaShow = productSelect.quota_show || 0;
				let quota = productSelect.quota || 0;
				let productStock = productSelect.product_stock || 0;
				let num = this.attribute.productSelect;
				let nums = this.storeInfo.num || 0;
				let onceNum = this.storeInfo.once_num || 0;
				//设置默认数据
				if (productSelect.cart_num == undefined) productSelect.cart_num = 1;
				if (changeValue) {
					num.cart_num++;
					let arrMin = [];
					arrMin.push(nums);
					arrMin.push(onceNum);
					arrMin.push(quota);
					arrMin.push(productStock);
					let minN = Math.min.apply(null, arrMin);
					if (num.cart_num >= minN) {
						this.$set(this.attribute.productSelect, "cart_num", minN ? minN : 1);
						this.$set(this, "cart_num", minN ? minN : 1);
					}
					// if(quotaShow >= productStock){
					// 	 if (num.cart_num > productStock) {
					// 	 	this.$set(this.attribute.productSelect, "cart_num", productStock);
					// 	 	this.$set(this, "cart_num", productStock);
					// 	 }
					// }else{
					// 	if (num.cart_num > quotaShow) {
					// 		this.$set(this.attribute.productSelect, "cart_num", quotaShow);
					// 		this.$set(this, "cart_num", quotaShow);
					// 	}
					// }
					this.$set(this, "cart_num", num.cart_num);
					this.$set(this.attribute.productSelect, "cart_num", num.cart_num);

				} else {
					num.cart_num--;
					if (num.cart_num < 1) {
						this.$set(this.attribute.productSelect, "cart_num", 1);
						this.$set(this, "cart_num", 1);
					}
					this.$set(this, "cart_num", num.cart_num);
					this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
				}
			},
			attrVal(val) {
				this.attribute.productAttr[val.indexw].index = this.attribute.productAttr[val.indexw].attr_values[val
					.indexn];
			},
			/**
			 * 属性变动赋值
			 * 
			 */
			ChangeAttr: function(res) {
				this.$set(this, 'cart_num', 1);
				let productSelect = this.productValue[res];
				this.$set(this, "selectSku", productSelect);
				if (productSelect) {
					this.$set(this.attribute.productSelect, "image", productSelect.image);
					this.$set(this.attribute.productSelect, "price", productSelect.price);
					this.$set(this.attribute.productSelect, "stock", productSelect.stock);
					this.$set(this.attribute.productSelect, "unique", productSelect.unique);
					this.$set(this.attribute.productSelect, "cart_num", 1);
					this.$set(this.attribute.productSelect, "quota", productSelect.quota);
					this.$set(this.attribute.productSelect, "quota_show", productSelect.quota_show);
					this.$set(this, "attrValue", res);

					this.attrTxt = "已选择"
				} else {
					this.$set(this.attribute.productSelect, "image", this.storeInfo.image);
					this.$set(this.attribute.productSelect, "price", this.storeInfo.price);
					this.$set(this.attribute.productSelect, "stock", 0);
					this.$set(this.attribute.productSelect, "unique", "");
					this.$set(this.attribute.productSelect, "cart_num", 0);
					this.$set(this.attribute.productSelect, "quota", 0);
					this.$set(this.attribute.productSelect, "quota_show", 0);
					this.$set(this, "attrValue", "");
					this.attrTxt = "已选择"

				}
			},
			scroll: function(e) {
				var that = this,
					scrollY = e.detail.scrollTop;
				var opacity = scrollY / 200;
				opacity = opacity > 1 ? 1 : opacity;
				that.opacity = opacity
				that.scrollY = scrollY
				that.currentPage = false;
				if (that.lock) {
					that.lock = false
					return;
				}
				for (var i = 0; i < that.topArr.length; i++) {
					if (scrollY < that.topArr[i] - (app.globalData.navHeight / 2) + that.heightArr[i]) {
						that.navActive = i
						break
					}
				}
			},
			tap: function(item, index) {
				var id = item.id;
				var index = index;
				var that = this;
				if (!this.replyCount && id == "past1") {
					id = "past2"
				}
				this.toView = id;
				this.navActive = index;
				this.lock = true;
				this.scrollTop = index > 0 ? that.topArr[index] - (app.globalData.navHeight / 2) : that.topArr[index]
			},
			infoScroll: function() {
				var that = this,
					topArr = [],
					heightArr = [];
				for (var i = 0; i < that.navList.length; i++) { //productList
					//获取元素所在位置
					var query = wx.createSelectorQuery().in(this);
					var idView = "#past" + i;
					if (!this.replyCount && i == 1) {
						idView = "#past" + 2;
					}
					query.select(idView).boundingClientRect();
					query.exec(function(res) {
						var top = res[0].top;
						var height = res[0].height;
						topArr.push(top);
						heightArr.push(height);
						that.topArr = topArr
						that.heightArr = heightArr
					});
				};
			},
			/**
			 * 收藏商品
			 */
			setCollect: function() {
				var that = this;
				if (this.storeInfo.userCollect) {
					collectDel(this.storeInfo.product_id).then(res => {
						that.storeInfo.userCollect = !that.storeInfo.userCollect
					})
				} else {
					collectAdd(this.storeInfo.product_id).then(res => {
						that.storeInfo.userCollect = !that.storeInfo.userCollect
					})
				}
			},
			/*
			 *  单独购买
			 */
			openAlone: function() {
				uni.navigateTo({
					url: `/pages/goods_details/index?id=${this.storeInfo.product_id}`
				})
			},
			/*
			 *  下订单
			 */
			goCat: function() {
				var that = this;
				that.currentPage = false;
				var productSelect = this.productValue[this.attrValue];
				//打开属性
				if (this.isOpen)
					this.attribute.cartAttr = true
				else
					this.attribute.cartAttr = !this.attribute.cartAttr
				//只有关闭属性弹窗时进行加入购物车
				if (this.attribute.cartAttr === true && this.isOpen == false) return this.isOpen = true
				//如果有属性,没有选择,提示用户选择
				if (this.attribute.productAttr.length && productSelect === undefined && this.isOpen == true) return app
					.$util.Tips({
						title: '请选择属性'
					});
				postCartAdd({
					productId: that.storeInfo.product_id,
					secKillId: that.id,
					bargainId: 0,
					combinationId: 0,
					cartNum: that.cart_num,
					uniqueId: productSelect !== undefined ? productSelect.unique : '',
					'new': 1
				}).then(res => {
					this.isOpen = false
					uni.navigateTo({
						url: '/pages/users/order_confirm/index?new=1&cartId=' + res.data.cartId
					});
				}).catch(err => {
					return this.$util.Tips({
						title: err
					});
				});
			},
			/**
			 * 分享打开
			 * 
			 */
			listenerActionSheet: function() {
				this.currentPage = false
				if (this.isLogin === false) {
					toLogin();
				} else {
					// #ifdef H5
					if (this.$wechat.isWeixin() === true) {
						this.weixinStatus = true;
					}
					// #endif
					this.posters = true;
					this.goPoster();
				}
			},
			// 分享关闭
			listenerActionClose: function() {
				this.posters = false;
			},
			//隐藏海报
			posterImageClose: function() {
				this.posterImageStatus = false;
				this.posters = false;
			},
			//替换安全域名
			setDomain: function(url) {
				url = url ? url.toString() : '';
				//本地调试打开,生产请注销
				if (url.indexOf("https://") > -1) return url;
				else return url.replace('http://', 'https://');
			},
			//获取海报产品图
			downloadFilestoreImage: function() {
				let that = this;
				uni.downloadFile({
					url: that.setDomain(that.storeInfo.image),
					success: function(res) {
						that.storeImage = res.tempFilePath;
						that.base64Show = 1;
					},
					fail: function() {
						return that.$util.Tips({
							title: ''
						});
						that.storeImage = '';
					},
				});
			},
			/**
			 * 获取产品分销二维码
			 * @param function successFn 下载完成回调
			 * 
			 */
			downloadFilePromotionCode: function(successFn) {
				let that = this;
				seckillCode(that.id, {
					stop_time: that.datatime
				}).then(res => {
					uni.downloadFile({
						url: that.setDomain(res.data.code),
						success: function(res) {
							that.$set(that, 'isDown', false);
							if (typeof successFn == 'function')
								successFn && successFn(res.tempFilePath);
							else
								that.$set(that, 'PromotionCode', res.tempFilePath);
						},
						fail: function() {
							that.$set(that, 'isDown', false);
							that.$set(that, 'PromotionCode', '');
						},
					});
				}).catch(err => {
					that.$set(that, 'isDown', false);
					that.$set(that, 'PromotionCode', '');
				});
			},
			getImageBase64: function(type) {
				let that = this;
				imageBase64(that.storeImage, that.followCode)
					.then(res => {
						that.storeImage = res.data.image;
						if (type) {
							that.PromotionCode = res.data.code;
						}
						that.base64Show = 1;
					})
					.catch(() => {});
			},
			// 小程序关闭分享弹窗；
			// goFriend: function() {
			// 	this.posters = false;
			// },
			/**
			 * 生成海报
			 */
			goPoster: function() {
				let that = this;
				// that.posters = false;
				that.$set(that, 'canvasStatus', true);
				let arr2 = [that.posterbackgd, that.storeImage, that.PromotionCode];
				// #ifdef MP
				if (that.PromotionCode == '' && !that.isDown) {
					return that.$util.Tips({
						title: '小程序二维码需要发布正式版后才能获取到'
					}, function() {
						that.posters = false;
					});
				}
				// #endif
				if (that.isDown) return that.$util.Tips({
					title: '正在下载海报,请稍后再试！'
				}, function() {
					that.posters = false;
				});
				uni.getImageInfo({
					src: that.PromotionCode,
					fail: function(res) {
						return that.$util.Tips({
							title: '小程序二维码需要发布正式版后才能获取到'
						});
					},
					success() {
						if (arr2[2] == '') {
							//海报二维码不存在则从新下载
							that.downloadFilePromotionCode(function(msgPromotionCode) {
								arr2[2] = msgPromotionCode;
								if (arr2[2] == '')
									return that.$util.Tips({
										title: '海报二维码生成失败！'
									});
								that.$nextTick(() => {
									that.$util.PosterCanvas(that.fontColor, that.themeColor,
										that.siteName, arr2, that.storeInfo.title, that
										.storeInfo
										.price, that.storeInfo.ot_price,
										function(tempFilePath) {
											that.$set(that, 'posterImage', tempFilePath);
											that.$set(that, 'posterImageStatus', true);
											that.$set(that, 'canvasStatus', false);
											that.$set(that, 'actionSheetHidden', !that
												.actionSheetHidden);
										});
								})
							});

						} else {
							//生成推广海报
							that.$nextTick(function() {
								that.$util.PosterCanvas(that.fontColor, that.themeColor, that.siteName,
									arr2, that.storeInfo.title, that.storeInfo.price, that
									.storeInfo.ot_price,
									function(tempFilePath) {
										that.$set(that, 'posterImage', tempFilePath);
										that.$set(that, 'posterImageStatus', true);
										that.$set(that, 'canvasStatus', false);
										that.$set(that, 'actionSheetHidden', !that
											.actionSheetHidden);
									});
							})
						}
					},
				});
			},

			/*
			 * 保存到手机相册
			 */
			// #ifdef MP
			savePosterPath: function() {
				let that = this;
				uni.getSetting({
					success(res) {
						if (!res.authSetting['scope.writePhotosAlbum']) {
							uni.authorize({
								scope: 'scope.writePhotosAlbum',
								success() {
									uni.saveImageToPhotosAlbum({
										filePath: that.posterImage,
										success: function(res) {
											that.posterImageClose();
											that.$util.Tips({
												title: '保存成功',
												icon: 'success'
											});
										},
										fail: function(res) {
											that.$util.Tips({
												title: '保存失败'
											});
										}
									})
								}
							})
						} else {
							uni.saveImageToPhotosAlbum({
								filePath: that.posterImage,
								success: function(res) {
									that.posterImageClose();
									that.$util.Tips({
										title: '保存成功',
										icon: 'success'
									});
								},
								fail: function(res) {
									that.$util.Tips({
										title: '保存失败'
									});
								},
							})
						}
					}
				})
			},
			// #endif
			//#ifdef APP-PLUS
			savePosterPath() {
				let that = this
				uni.saveImageToPhotosAlbum({
					filePath: that.posterImage,
					success: function(res) {
						that.posterImageClose();
						that.$util.Tips({
							title: '保存成功',
							icon: 'success'
						});
					},
					fail: function(res) {
						that.$util.Tips({
							title: '保存失败'
						});
					}
				});
			},
			// #endif
			setShareInfoStatus: function() {
				let data = this.storeInfo;
				let href = location.href;
				if (this.$wechat.isWeixin()) {
					this.posters = true;
					getUserInfo().then(res => {
						href =
							href.indexOf("?") === -1 ?
							href + "?spread=" + res.data.uid :
							href + "&spread=" + res.data.uid;

						let configAppMessage = {
							desc: data.store_info,
							title: data.store_name,
							link: href,
							imgUrl: data.image
						};
						this.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
							configAppMessage)
					});
				}
			}
		},
		//#ifdef MP
		onShareAppMessage() {
			return {
				title: this.storeInfo.title,
				path: app.globalData.openPages,
			};
		}
		//#endif
	}
</script>

<style lang="scss">
	.detail_view {
		background-size: contain;
		background-repeat: repeat-y;
		background-position: center;

		.content_ {
			padding: 26rpx;

			>view {
				border-radius: 20rpx;
			}
		}
	}

	.songhuo {
		width: 100%;
		font-size: 15px;
		color: #333;
		padding: 0 16px;
		background-color: #fff;
		margin-top: 11px;
	}

	.songhuo .title {
		height: 55rpx;
	}

	.store {
		background-color: #fff;
		margin-top: 20rpx;

		.title {
			height: 80rpx;
			width: 100%;
			font-size: 28rpx;
			color: #333;
			padding: 0 30rpx;

			.icon-jinru2 {
				color: #7a7a7a;
				font-size: 28rpx;
			}
		}
	}

	.generate-posters {
		width: 100%;
		height: 318rpx;
		background-color: #fff;
		position: fixed;
		left: 0;
		bottom: 0;
		z-index: 300;
		transform: translate3d(0, 100%, 0);
		transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
		border-top: 1rpx solid #eee;

		.generateCon {
			height: 220rpx;
		}

		.generateClose {
			height: 98rpx;
			font-size: 28rpx;
			color: #333333;
			border-top: 1px solid #eee;
		}

		.item {
			.pictrue {
				width: 96rpx;
				height: 96rpx;
				border-radius: 50%;
				margin: 0 auto 6rpx auto;

				image {
					width: 100%;
					height: 100%;
					border-radius: 50%;
				}
			}
		}
	}

	.generate-posters.on {
		transform: translate3d(0, 0, 0);
	}

	.generate-posters .item {
		flex: 1;
		text-align: center;
		font-size: 30rpx;
	}

	.generate-posters .item .iconfont {
		font-size: 80rpx;
		color: #5eae72;
	}

	.generate-posters .item .iconfont.icon-haibao {
		color: #5391f1;
	}

	.navbar .header {
		height: 96rpx;
		font-size: 30rpx;
		color: #050505;
		background-color: #fff;
		/* #ifdef MP */
		padding-right: 95rpx;
		/* #endif */
		/* #ifdef APP-PLUS */
		width: 100%;
		/* #endif */
	}

	.icon-xiangzuo {
		/* #ifdef H5 */
		top: 30rpx !important;
		/* #endif */
	}

	.navbar .header .item {
		position: relative;
		margin: 0 25rpx;
	}

	.navbar .header .item.on:before {
		position: absolute;
		width: 60rpx;
		height: 5rpx;
		background-repeat: no-repeat;
		content: "";
		// background-image: linear-gradient(to right, #ff3366 0%, #ff6533 100%);
		background-color: var(--view-theme);
		bottom: -10rpx;
		left: 50%;
		margin-left: -28rpx;
	}

	.navbar {
		position: fixed;
		background-color: #fff;
		top: 0;
		left: 0;
		z-index: 99;
		width: 100%;
	}

	.navbar .navbarH {
		position: relative;
	}

	.navbar .navbarH .navbarCon {
		position: absolute;
		bottom: 0;
		height: 100rpx;
		width: 100%;
	}

	.icon-xiangzuo {
		/* color: #000;
		position: fixed;
		font-size: 40rpx;
		width: 100rpx;
		height: 56rpx;
		line-height: 54rpx;
		z-index: 1000;
		left: 33rpx; */
	}

	.product-con .nav {
		background-image: linear-gradient(90deg,
				#01afbb 0%,
				#0ccb79 100%);
		background-repeat: no-repeat;
		background-size: 100% 100%;
		width: 100%;
		height: 100rpx;
		padding: 0 30rpx;
		box-sizing: border-box;
	}

	.product-con .nav /deep/.time .styleAll {
		padding: 0 6rpx;
		font-size: 22rpx;
		color: #0ccb79;
		background-color: #fff;
		border-radius: 2rpx
	}

	.product-con .nav .money {
		font-family: SourceHanSansCN-Bold;
		font-size: 40rpx;
		font-weight: normal;
		font-style: italic;
		font-stretch: normal;
		letter-spacing: 0px;
		color: #ffffff;

		image {
			width: 28rpx;
			height: 40rpx;
			vertical-align: middle;
			margin-right: 5rpx;
		}
	}

	.product-con .nav .money .num {
		font-size: 48rpx;
	}

	.product-con .nav .money .y-money {
		font-size: 26rpx;
		margin-left: 10rpx;
		text-decoration: line-through;
	}

	.product-con .nav .timeItem {
		font-size: 20rpx;
		color: #fff;
		text-align: center;
		display: flex;
		align-items: center;
	}

	.product-con .nav .timeItem .timeCon {
		margin-top: 10rpx;
	}

	.product-con .nav .timeItem .timeCon .num {
		padding: 0 7rpx;
		font-size: 22rpx;
		color: #ff3d3d;
		background-color: #fff;
		border-radius: 2rpx;
	}

	.product-con .nav .timeState {
		font-size: 28RPX;
		color: #FFF;
	}

	.product-con .nav .iconfont {
		color: #fff;
		font-size: 30rpx;
		margin-left: 20rpx;
	}

	.product-con .wrapper {
		width: 100%;
		box-sizing: border-box;
		padding-top: 32rpx;

		.ISactive {
			margin-top: 20rpx;
			padding: 0 32rpx;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			color: #999999;

			.left {
				font-size: 24rpx;
				color: #999999;
				margin-right: 10rpx;
			}

			.box {
				width: 184rpx;
				height: 45rpx;
				background-color: #df2e26;
				border-radius: 23rpx;
				color: #fff;
				line-height: 45rpx;
				font-size: 26rpx;
				font-weight: bold;
				text-align: center;

				image {
					width: 27rpx;
					height: 25rpx;
					margin-right: 10rpx;
				}
			}

		}

		&.wrapper4 {
			padding-top: 0;
			margin-top: 28rpx;
			padding-bottom: 10rpx;

			.list {
				width: 100%;

				>view {
					width: 100%;
					padding: 0 45rpx;
					height: 100rpx;
					line-height: 100rpx;

					image {
						width: 57rpx;
						height: 57rpx;
						margin-right: 16rpx;
						vertical-align: middle;
					}

					text {
						font-size: 24rpx;
						color: #333333;
					}

					&:not(:last-child) {
						border-bottom: 1px solid #e2e7ea;
					}
				}
			}

			.title {
				margin: 0 13rpx;
				display: flex;
				align-items: center;
				flex-wrap: nowrap;
				height: 95rpx;
				padding: 20rpx 20rpx 0rpx 20rpx;
				background-repeat: no-repeat;
				background-size: contain;
				background-repeat: center;
				position: relative;
				justify-content: space-between;

				.tab_icon {
					width: 42rpx;
					height: 38rpx;
					position: absolute;
					left: 26rpx;
					top: 29rpx;
				}

				.pictrue {
					width: 205rpx;
					padding-left: 90rpx;
					text-align: left;
					font-family: TCYXHLOGOMH--GB1-0;
					font-size: 40rpx;
					font-weight: normal;
					font-stretch: normal;
					letter-spacing: 1px;
					color: #ffffff;
					text-shadow: 0px 2px 3px rgba(0, 0, 0, .26);
					box-sizing: content-box;
					position: relative;
				}
			}
		}

		&.wrapper3 {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 28rpx;
			padding: 40rpx 0;

			>view {
				text-align: center;
				width: 33%;

				image {
					width: 50rpx;
					height: 50rpx;
				}

				.title {
					margin-top: 20rpx;
					font-size: 30rpx;
					color: #333333;
					font-weight: bold;
				}

				.msg {
					margin-top: 15rpx;
					font-size: 24rpx;
					color: #999999;
				}
			}
		}

		&.wrapper5 {
			.list {
				.listDV {
					height: auto;
					padding: 32rpx 45rpx;
					display: flex;
					justify-content: space-between;
					align-items: center;

					.left {
						display: flex;
						justify-content: space-between;
						align-items: center;

						image {
							width: 80rpx;
							height: 84rpx;
							min-width: 80rpx;
							margin-right: 20rpx;
						}

						.dv {
							view {
								height: auto;
								line-height: 1;
							}

							.dv1 {
								font-size: 30rpx;
								color: #333;
								font-weight: bold;
							}

							.dv2 {
								font-size: 22rpx;
								color: #999999;
								margin-top: 10rpx;
							}

							.dv3 {
								font-size: 22rpx;
								color: #5e5e5e;
								margin-top: 15rpx;
							}
						}

					}
				}
			}
		}

		.introduce_bottom {
			width: 100%;
			margin-top: 29rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-top: 1px solid #e2e7ea;

			>view {
				padding: 40rpx 0;
				text-align: center;
				width: 33%;
				height: 100%;

				&:not(:last-child) {
					border-right: 1px solid #ededed;
				}

				.title {
					font-size: 30rpx;
					color: #333333;
					font-weight: bold;
				}

				.msg {
					margin-top: 15rpx;
					font-size: 24rpx;
					color: #999999;
				}
			}
		}

		.price_box {
			padding: 0 32rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.iconfont {
				font-size: 40rpx;
				color: #515151;
				font-weight: bold;
			}

			.price {
				font-size: 43rpx;
				color: #df2e26;
				font-weight: bold;

				.num {
					font-size: 51rpx;
				}

				.y-money {
					font-size: 30rpx;
					color: #999999;
					text-decoration: line-through;
					font-weight: 400;
				}


			}
		}
	}
	.product-con .wrapper .introduce {
		margin: 0;
		margin-top: 50rpx;
		padding: 0 32rpx;

		.infor {
			font-size: 40rpx;
			color: #301e00;
		}

	}
	.product-con .wrapper .introduce .infor {
		width: 570rpx;
	}

	.product-con .wrapper .introduce .iconfont {
		font-size: 37rpx;
		color: #515151;
	}

	.product-con .wrapper .label {
		margin: 18rpx 0 0 0;
		font-size: 24rpx;
		color: #82848f;
		display: flex;
		justify-content: space-between;
	}

	.product-con .wrapper .label .stock {
		width: 255rpx;
		margin-right: 28rpx;
	}

	.product-con .footer {
		padding: 0 0rpx 0 30rpx;
		position: fixed;
		bottom: 0;
		width: 100%;
		box-sizing: border-box;
		background-color: #fff;
		z-index: 277;
		height: 100rpx;
		height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
		height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
	}

	.product-con .footer .item {
		font-size: 18rpx;
		color: #666;
	}

	.product-con .footer .item .iconfont {
		text-align: center;
		font-size: 40rpx;
	}

	.product-con .footer .item .iconfont.icon-shoucang1 {
		color: var(--view-theme);
	}

	.product-con .footer .item .iconfont.icon-gouwuche1 {
		font-size: 40rpx;
		position: relative;
	}

	.product-con .footer .item .iconfont.icon-gouwuche1 .num {
		color: #fff;
		position: absolute;
		font-size: 18rpx;
		padding: 2rpx 8rpx 3rpx;
		border-radius: 200rpx;
		top: -10rpx;
		right: -10rpx;
	}

	.product-con .footer .bnt {
		width: 540rpx;
		height: 100%;
	}

	.product-con .footer .bnt .bnts {
		width: 270rpx;
		text-align: center;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #fff;
		font-size: 30rpx;
	}

	.product-con .footer .bnt .joinCart {
		// background-image: linear-gradient(to right, #fea10f 0%, #fa8013 100%);
		// background-color: var(--view-bntColor);
		background-color: #ffc1be;
		color: #df2e26;
	}

	.product-con .footer .bnt .buy {
		// background-color: var(--view-theme);
		background-color: #df2e26;
		// background-image: linear-gradient(to right, #fa6514 0%, #e93323 100%);
	}

	.product-con .conter {
		display: block;
		padding-bottom: 150rpx;
		background-color: #FFFFFF;
	}

	.product-con .conter img {
		display: block;
	}

	.setCollectBox {
		font-size: 18rpx;
		color: #666;
	}

	.bg-color-hui {
		background: #bbbbbb !important;
	}

	.canvas {
		width: 750px;
		height: 1300px;
	}

	.poster-pop {
		width: 460rpx;
		height: 800rpx;
		position: fixed;
		left: 50%;
		transform: translateX(-50%);
		z-index: 300;
		top: 16%;
	}

	.poster-pop image {
		width: 100%;
		height: 100%;
		display: block;
		border-radius: 18rpx;
	}

	.poster-pop .close {
		width: 46rpx;
		height: 75rpx;
		position: fixed;
		right: 0;
		top: -73rpx;
		display: block;
	}

	.poster-pop .save-poster {
		background-color: #df2d0a;
		font-size: ：22rpx;
		color: #fff;
		text-align: center;
		height: 76rpx;
		line-height: 76rpx;
		width: 100%;
	}

	.poster-pop .keep {
		color: #fff;
		text-align: center;
		font-size: 25rpx;
		margin-top: 10rpx;
	}

	/deep/.mask {
		z-index: 99 !important;
	}

	.mask1 {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: #000;
		opacity: .5;
		z-index: 288;
	}

	.home-nav {
		/* #ifdef H5 */
		top: 20rpx !important;
		/* #endif */
	}

	.home-nav {
		color: #333;
		position: fixed;
		/* #ifdef MP */
		width: 126rpx;
		left: 15rpx;
		/* #endif */
		/* #ifndef MP */
		width: 56rpx;
		left: 33rpx;
		/* #endif */
		height: 56rpx;
		font-size: 33rpx;
		z-index: 99;
		background: rgba(255, 255, 255, 0.3);
		border: 1px solid rgba(0, 0, 0, 0.1);
		border-radius: 40rpx;

		&.right {
			right: 33rpx;
			left: unset
		}

		&.on {
			background: unset;
			color: #333;
		}

		&.homeIndex {
			/* #ifdef MP */
			width: 98rpx;
			/* #endif */
			/* #ifndef MP */
			border-color: rgba(255, 255, 255, 0);
			/* #endif */
		}
	}

	.home-nav .iconfont {
		width: 60rpx;
		text-align: center;
	}

	.home-nav .line {
		width: 1rpx;
		height: 34rpx;
		background: #B3B3B3;
	}

	.home-nav .icon-xiangzuo {
		width: auto;
		font-size: 28rpx;
	}

	.share-box {
		z-index: 1000;
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
	}

	.share-box image {
		width: 100%;
		height: 100%;
	}
</style>
